Skip to content

Handle zero-update numerical stagnation in the SVM solver - #8609

Open
viclafargue wants to merge 1 commit into
NVIDIA:mainfrom
viclafargue:fix-svm-zero-delta-stagnation
Open

Handle zero-update numerical stagnation in the SVM solver#8609
viclafargue wants to merge 1 commit into
NVIDIA:mainfrom
viclafargue:fix-svm-zero-delta-stagnation

Conversation

@viclafargue

Copy link
Copy Markdown
Contributor

Closes #8579.

Reset the kernel-cache state when an SMO iteration produces no coefficient
updates, then raise an actionable numerical-stagnation error if convergence
has not been reached.

Adds C++ and Python regression tests.

@copy-pr-bot

copy-pr-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added Cython / Python Cython or Python issue CUDA/C++ labels Sep 10, 2026
@viclafargue viclafargue added bug Something isn't working non-breaking Non-breaking change labels Sep 11, 2026
@viclafargue
viclafargue marked this pull request as ready for review September 11, 2026 08:17
@viclafargue
viclafargue requested review from a team as code owners September 11, 2026 08:17
@viclafargue
viclafargue requested a review from csadorf September 11, 2026 08:17
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 447ad060-59c4-46d8-a755-8188aeba38c3

📥 Commits

Reviewing files that changed from the base of the PR and between 2c037a5 and 5e4d9f5.

📒 Files selected for processing (4)
  • cpp/src/svm/kernelcache.cuh
  • cpp/src/svm/smosolver.cuh
  • cpp/tests/sg/svc_test.cu
  • python/cuml/tests/test_svm.py

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Improved SVM solver handling when optimization makes no progress.
    • Added clearer errors for numerical precision or scaling issues, including guidance to use higher precision where appropriate.
    • Improved kernel-cache state handling when no coefficient updates occur.
  • Tests

    • Added coverage for completing and restarting kernel-cache working sets.
    • Added regression coverage for stalled float32 polynomial SVR training.

Walkthrough

The change adds KernelCache::FinishWorkingSet(), uses it when the SMO solver makes no alpha update, and raises precision-specific errors when optimization stagnates. C++ and Python tests cover working-set reuse and float32 SVR stagnation.

Changes

SVR working-set completion

Layer / File(s) Summary
Kernel cache working-set lifecycle
cpp/src/svm/kernelcache.cuh, cpp/tests/sg/svc_test.cu
KernelCache::FinishWorkingSet() transitions an initialized working set to READY. Typed tests cover repeated initialization and completion.
Solver completion and stagnation handling
cpp/src/svm/smosolver.cuh, python/cuml/tests/test_svm.py
The solver tracks alpha updates, completes inactive working sets, and raises precision-specific errors when it cannot continue without progress. The regression test checks the float32 error message.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 5e4d9

The SVR failure path now produces an actionable numerical-stagnation error rather than an internal kernel-cache exception.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The smosolver.cuh copyright header change adds & AFFILIATES. All rights reserved.. This change has no demonstrated connection to the kernel-cache failure or its regression tests. The remaining imp… Remove the unrelated copyright-header change from cpp/src/svm/smosolver.cuh, unless a separate repository requirement justifies it.
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description accurately summarizes the kernel-cache reset, numerical-stagnation error, and regression tests in the changeset.
Title check ✅ Passed The title clearly and concisely describes the main change: handling zero-update numerical stagnation in the SVM solver.
Linked Issues check ✅ Passed The changes address #8579. FinishWorkingSet() closes an initialized cache when an SMO iteration has no coefficient updates. The solver then raises a clear SMO error with float-precision or kernel-…
Full details: Out of Scope Changes check

Explanation

The smosolver.cuh copyright header change adds & AFFILIATES. All rights reserved.. This change has no demonstrated connection to the kernel-cache failure or its regression tests. The remaining implementation and tests support #8579.

Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CUDA/C++ Cython / Python Cython or Python issue non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] SVR with a degree=10 polynomial kernel fails with an internal working-set state error

2 participants